package com.example.demo.demos.web.Services.impl;

import com.example.demo.demos.web.Services.UserLoginService;
import com.example.demo.demos.web.mapper.UserMapper;
import com.example.demo.demos.web.po.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserLoginServiceImpl implements UserLoginService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public boolean login(User user) {
        if (user !=null){
            List<User> users =  userMapper.selectByUser(user);
            if (!users.isEmpty()){return true;}else return false;
        }else {
            return false;
        }
    }
}
